home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
operation-graduates.swf
/
scripts
/
frame_41
/
DoAction_18.as
< prev
next >
Wrap
Text File
|
2011-10-17
|
3KB
|
109 lines
function createHUD()
{
createEmptyMovieClip("HUD",HUDDepth);
createLives();
createScore();
}
function createLives()
{
HUD.attachMovie("lifeThing","lives",11,{_x:595,_y:5});
i = 0;
while(i < theHull.lives)
{
HUD.lives.attachMovie("lifeHeart","lifeHeart" + i,i,{_x:i * -24 - 48});
i++;
}
}
function addLife()
{
if(theHull.lives < 12)
{
theHull.lives = theHull.lives + 1;
i = 0;
while(i < theHull.lives)
{
HUD.lives.attachMovie("lifeHeart","lifeHeart" + i,i,{_x:i * -24 - 48});
i++;
}
}
}
function createScore()
{
var tempScore = theHull.score;
var tempDigit;
var tempPow;
extraLifeThing = Math.floor(theHull.score / 10000);
i = 6;
while(i >= 0)
{
tempPow = Math.pow(10,i);
tempDigit = Math.floor(tempScore / tempPow);
HUD.attachMovie("number","dig" + i,i,{_x:i * -10 + 66,_y:3});
eval("HUD.dig" + i).gotoAndStop(tempDigit + 1);
tempScore %= tempPow;
i--;
}
}
function addScore(newPoints)
{
var tempScore = theHull.score += newPoints;
var tempDigit;
var tempPow;
i = 6;
while(i >= 0)
{
tempPow = Math.pow(10,i);
tempDigit = Math.floor(tempScore / tempPow);
eval("HUD.dig" + i).gotoAndStop(tempDigit + 1);
tempScore %= tempPow;
i--;
}
}
function doLetterbox()
{
var _loc1_ = this;
createEmptyMovieClip("letterbox",5500);
letterbox.attachMovie("letterboxT","top",1,{_x:0,_y:0});
letterbox.attachMovie("letterboxB","bottom",2,{_x:0,_y:400});
letterbox.t = 0;
letterbox.s = 0;
letterbox.c = 30;
letterbox.d = 5;
letterbox.onEnterFrame = function()
{
var _loc1_ = this;
if(_loc1_.t < _loc1_.d)
{
_loc1_.t = _loc1_.t + 1;
_loc1_.top._height = Math.easeInQuad(_loc1_.t,_loc1_.s,_loc1_.c,_loc1_.d);
_loc1_.bottom._height = Math.easeInQuad(_loc1_.t,_loc1_.s,_loc1_.c,_loc1_.d);
if(_loc1_.t == _loc1_.d)
{
_loc1_.onEnterFrame = null;
}
}
};
}
function undoLetterbox()
{
var _loc1_ = this;
letterbox.t = 0;
letterbox.s = 30;
letterbox.c = -30;
letterbox.d = 5;
letterbox.onEnterFrame = function()
{
var _loc1_ = this;
if(_loc1_.t < _loc1_.d)
{
_loc1_.t = _loc1_.t + 1;
_loc1_.top._height = Math.easeInQuad(_loc1_.t,_loc1_.s,_loc1_.c,_loc1_.d);
_loc1_.bottom._height = Math.easeInQuad(_loc1_.t,_loc1_.s,_loc1_.c,_loc1_.d);
}
if(_loc1_.t == _loc1_.d)
{
_loc1_.removeMovieClip();
}
};
}